package designPattern.singletonPattern;

/**
 * LazySingleton
 *
 * @author nanxin.chen
 * @date 2015/11/3
 */
public class LazySingleton {
    private static LazySingleton singleton = null;

    private LazySingleton() {
        System.out.println("create a singleton instance.");
    }

    public static synchronized LazySingleton getInstance() {
        if (singleton == null) {
            singleton =  new LazySingleton();
        }
        return singleton;
    }
}
